#include <vector>
#include <iostream>
using namespace std;

void merge_Sort(vector<int>&nums,vector<int>&help,int left,int right)
{
    if(left>=right) return;
    int mid=(right-left)/2+left;
    merge_Sort(nums,help,left,mid);
    merge_Sort(nums,help,mid+1,right);
    int begin1=left;
    int end1=mid;
    int begin2=mid+1;
    int end2=right;
    int i=left;
    while(begin1<=end1&&begin2<=end2)
    {
        if(nums[begin1]<=nums[begin2])
        {
            help[i++]=nums[begin1++];
        }
        else
        {
            help[i++]=nums[begin2++];
        }
    }
    while(begin1<=end1)
    {
        help[i++]=nums[begin1++];
    }
    while(begin2<=end2)
    {
        help[i++]=nums[begin2++];
    }
    for(int j=left;j<=right;j++)
    {
        nums[j]=help[j];
    }
}
void mergeSort(std::vector<int> &nums)
{
   vector<int>help(nums.size(),0);
   merge_Sort(nums,help,0,nums.size()-1);
}
int main()
{
    int n;
    cin >> n;
    vector<int> arr(n, 0);
    for (auto &ch : arr)
    {
        cin >> ch;
    };
    mergeSort(arr);
    for (auto &ch : arr)
    {
        cout << ch << " ";
    };
    return 0;
}